#include<iostream>
using namespace std;
using ll = long long;
const int N = 25, mod = 1e9 + 7;
ll A[N];
ll n, m, down = 1;
ll qmi(ll a, ll k, ll p)
{
    ll res = 1;
    while (k)
    {
        if (k & 1) res = res * a % mod;
        a = a * a % mod;
        k >>= 1;
    }
    return res;
}
ll C(ll a, ll b)
{
    if (a < b) return 0;
    ll up = 1;
    for (ll i = a; i > a - b; i--) up = i % mod * up % mod;
    return up * down % mod;
}
int main()
{
    cin >> n >> m;
    for (int i = 0; i < n; i++) cin >> A[i];
    ll res = 0;
    for (ll j = n - 1; j > 0; j--) down = down * j % mod;
    down = qmi(down, mod - 2, mod);
    for (int i = 0; i < 1 << n; i++)
    {
        ll a = m + n - 1, b = n - 1;
        ll sign = 1;
        for (int j = 0; j < n; j++)
        {
            if (i >> j & 1)
            {
                sign *= -1;
                a -= A[j] + 1;
            }
        }
        res = ((res + sign * C(a, b)) % mod + mod) % mod;
    }
    cout << res << endl;
    return 0;
}